package com.gxuwz.attend.service.instructor;

import com.gxuwz.attend.dao.instructor.AuditDao;
import com.gxuwz.attend.entity.Leave;

import java.util.List;

public class AuditService {
    private AuditDao auditDao;

    public void setAuditDao(AuditDao auditDao) {
        this.auditDao = auditDao;
    }

    public List<Leave> getLeave(String instID) {
        return auditDao.getLeaveRequestsByInstructor(instID);
    }

public boolean updateLeave(String leaveID, String status){

    String opinion;
    if (status.equals("1")){
            opinion ="同意";
        }else {
            opinion ="不同意";
        }
        int rs = auditDao.updateLeaveStatus(leaveID,status, opinion);
        if (rs>0){
            return true;
        }else {
            return false;
        }

}
}
